//
// Created by wxd on 2025/7/27.
//

#pragma once

#include "BaseCamera.h"

struct PerspectiveParams {
    float fov;
    float aspect;
    float zNear;
    float zFar;

    PerspectiveParams() : fov(0.f), aspect(0.f), zNear(0.f), zFar(0.f) {}

    PerspectiveParams(const float fov, const float aspect, const float near, const float far)
                     : fov(fov), aspect(aspect), zNear(near), zFar(far) {}

    PerspectiveParams(const PerspectiveParams&) = default;

    PerspectiveParams& operator=(const PerspectiveParams&) = default;
};

class PerspectiveCamera : public BaseCamera {
public:
    PerspectiveCamera();

    PerspectiveCamera(float fov, float aspect, float near, float far);

    explicit PerspectiveCamera(const PerspectiveParams& params) : m_PerspectiveParams(params) {}

    PerspectiveCamera(const PerspectiveParams& params, const glm::vec3 pos, const glm::vec3 up, const glm::vec3 right)
            : BaseCamera(pos, up, right), m_PerspectiveParams(params) {}

    ~PerspectiveCamera() override;

    glm::mat4 getProjectMatrix() override;

    void setPerspectiveParams(const PerspectiveParams& params);
private:
    PerspectiveParams m_PerspectiveParams;
};

